#!/bin/bash

echo "=== 快速测试修复后的系统 ==="

# 编译
echo "编译..."
gcc -o debug_test crypto_common.c simple_test.c 2>/dev/null

if [ $? -ne 0 ]; then
    echo "编译失败，检查错误："
    gcc -o debug_test crypto_common.c simple_test.c
    exit 1
fi

echo "编译成功，运行调试测试..."
./debug_test

echo ""
echo "=== 测试实际文件 ==="
if [ -f "stream_chn0.h265" ]; then
    echo "使用 verify_crypto 测试..."
    ./bin/verify_crypto stream_chn0.h265 10086
else
    echo "未找到 stream_chn0.h265 文件"
fi

# 清理
rm -f debug_test

echo "=== 测试完成 ==="